<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 比较两个数或对象的 key value 是否一致 -->
    <script>
      let obj1 = {
        age: 21,
        name: 'lyy'
      }

      let obj2 = {
        age: 21,
        name: 'xxx'
      }
      //将js的值转为json字符串进行比较
      console.log(JSON.stringify(obj1) === JSON.stringify(obj2))
    </script>
  </body>
</html>
